<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Real Property and Business Permit</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="styles.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="nivo-slider.css" type="text/css" media="screen" />
<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="bg">
<div id="logo">
<img src="images/logo_and_name.png" alt="" width="305" height="78" />
</div>
<div id="main">
<div id="out"><h3><p align="right"><a href="user/index3.php">Home</a>&nbsp;&nbsp;|<a href="logout.php">logout</a></p></h3></div>
<!-- header begins -->
<div id="header">	
	
	<div id="slider-wrapper">        
					             <div id="slider" class="nivoSlider">
									<img src="images/header.jpg" alt="" title="" />
									<img src="images/header2.jpg" alt="" title="" />
									<img src="images/header3.jpg" alt="" title="" />
									<img src="images/header4.jpg" alt="" title="" />								
                                   	
		</div>        
      </div>
								
<script type="text/javascript" src="lib/jquery-1.4.3.min.js"></script>
    <script type="text/javascript" src="lib/jquery.nivo.slider.pack.js"></script>
    <script type="text/javascript">
    $(window).load(function() {
        $('#slider').nivoSlider();
    });
    </script>
    
    <script language="JavaScript">
function validate(){
if ((document.form2.uname.value=="") || (document.form2.lastname.value=="") ||(document.form2.firstname.value=="") ||(document.form2.password.value=="") ||(document.form2.emailadress.value==""))
{
window.alert("Please Enter Important Informations!");
return false;
}
 else
 {
 return true;
 }
}


</script>

	
</div>
        <div id="buttons">
		<ul>
			<li class="first"><a href="index3.php"  title="">Home</a></li>
			<a href="UserList.php" title="">User List</a></li>
            <li><a href="bpApp.php" title="Apply for Business Permit">Business</a></li>
			<li><a href="#" title="">Real Property</a></li>
			<li><a href="#" title="">Contact</a></li>
		</ul></div>
<!-- header ends -->
<!-- content begins -->
<div id="content_bg">
  <div class="container"><a href="UserList.php" title="">
    	<img src="images/back (2).png" title="back" width="38" height="38"></a>
<center>
        <font size="5"><strong><h3><center>
          ADD USER
          <center>
        </h3></strong></font>
        <table background="images/scroll3.jpg" border="0" width="650" cellpadding="15" cellspacing="10">
        <tr>
        <td>
        <center>
        <table width="262" border="0">
        <?php $z=2; ?>
        <form name="form2" method="post" action="">
        <tr><td background="images/scroll3.jpg">
        <input type="hidden" name="activate" id="activate" value="<?php echo $x; ?>">
        </td></tr>
          <tr>
            <td><font color="#00CCFF">User ID:</font></td>
            <td width="168"><span id="sprytextfield1">
              <label>
                <input type="text" name="uname" id="textfield">
              </label>
              <span class="textfieldRequiredMsg">A value is required.</span></span></td>
          </tr>
          <tr>
            <td><font color="#00CCFF">Last Name:</font></td>
            <td><span id="sprytextfield3">
              <input type="text" name="lastname" id="textfield2">
              <span class="textfieldRequiredMsg">A value is required.</span></span></td>
          </tr>
          <tr>
            <td><font color="#00CCFF">First Name:</font></td>
            <td><span id="sprytextfield5">
              <input type="text" name="firstname" id="textfield3">
              <span class="textfieldRequiredMsg">A value is required.</span></span></td>
          </tr>
          <tr>
            <td><font color="#00CCFF">Password</font></td>
            <td><span id="sprytextfield2">
              <input type="password" name="password" id="textfield4">
              <span class="textfieldRequiredMsg">A value is required.</span></span></td>
          </tr>
    
          <tr>
            <td><font color="#00CCFF">Email Adress: </font></td>
            <td><span id="sprytextfield4">
              <input type="text" name="emailadress" id="textfield5">
              <span class="textfieldRequiredMsg">A value is required.</span></span></td>
          </tr>
         
          <tr>
            <td>&nbsp;</td>
            <td><label>
              <input type="submit" name="btn_submit2" id="button" value="Submit" onClick="return validate()">
            </label></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          </form>  
        </table>
        <p>
        <?php
		
		if(isset($_POST['btn_submit2']))
		   {


	$db_name = "business-is";
	$table_name = "user";
	$user = "root";
	$pass = "";
	$connection = mysql_connect("localhost","$user","$pass")or die(mysql_error());
	$db = mysql_select_db($db_name, $connection) or die(mysql_error());
	$sql = "INSERT INTO $table_name(userid, uname, lastname, firstname, password, emailadress, activate) 
	VALUES 
	('','$_POST[uname]','$_POST[lastname]','$_POST[firstname]','$_POST[password]','$_POST[emailadress]','$_POST[activate]')";
	$result = mysql_query($sql, $connection) or die (mysql_error());
	echo "<font color=\"#000066\"><strong>REGISTRATION SUCCESSFUL</strong></font><br>";
	echo "<font color=\"#f9170c\" ><a href=\"UserList.php\">Please wait until your account has already approved. Check your account in User List</a></font>";
	
		   }
	
		?>
        </scenter>
        </center>
        </td>
        </tr>
        </table>
              
            
      </div>
       

</div>
<!-- content ends -->
<!-- footer begins -->
<div id="footer">
   <a href="http://validator.w3.org/check?uri=referer">Copyrights © 2012</a> | <a href="http://guinobatan.gov.ph/index.php/guinobatan/index">Municipality of Guinobatan</a>. | All rights reserved. 
      </p></div>
<!-- footer ends -->
</div>
</div>
<script type="text/javascript">
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3");
var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4");
var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5");
</script>
</body>
</html>